package com.atom.wyz.new_opengl.base;

import android.content.res.Resources;
import android.view.View;

import com.atom.wyz.new_opengl.util.ShaderUtil;
import com.atom.wyz.new_opengl.util.SimpleShaderBuffer;


public class ObjectVNT {

    String vertexShaderPath = "base/vertex_object_vnt.sh";
    String fragShaderPath = "base/frag_object_vnt.sh";

    TextureRect rect ;



    public ObjectVNT(float[] vertexArray , float[] normalArray , float[] texcoorsArray){
        rect = new TextureRect() ;
        SimpleShaderBuffer shaderBuffer = rect.getShaderBuffer();
        shaderBuffer.setVertexBuffer(vertexArray);
        shaderBuffer.setNormalBuffer(normalArray);
        shaderBuffer.setTexcoorBuffer(texcoorsArray);
    }

    public SimpleShaderBuffer getShaderBuffer() {
        return rect.getShaderBuffer();
    }

    public ObjectVNT(Resources resources, float[] vertexArray , float[] normalArray , float[] texcoorsArray ){
        this( vertexArray , normalArray , texcoorsArray) ;
        initProgram(resources);
    }

    private void initProgram(Resources resources) {
        rect.initProgram(resources);
    }
    private void initHandle(int mProgram) {
        rect.initShader(mProgram);
    }

    public void drawSelf(int textureid ) {
        rect.drawSelf(textureid);
    }
}
